<?php 
/**
 * 
 * Libreria de calendario 
 * @author natanael
 * 
 */
   if (!defined('BASEPATH')) exit('No se permite el acceso directo a la libreria Chcomspany');

   class Chcompany{ 

   	    public function hacerPing($url)
        {
              	 if($url == NULL) return false;  
                 $ch = curl_init($url);  
                 curl_setopt($ch, CURLOPT_TIMEOUT, 5);  
                 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);  
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
                 $data = curl_exec($ch);  
                 $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
                 curl_close($ch);  
               
                 if($httpcode>=200 && $httpcode<300){  
                     return true;  
                   } else {  
                       return false;  
                   }  
        }  
 
	
   
   }   